package com.example;

import org.junit.Test;

/**
 * @ClassName: leetcode
 * @Description:
 * @Author: csp
 * @Date:
 */
public class StringTest {
    public static void main(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        String s3 = new String("hello");
        String s4 = new String("hello");
        System.out.println(s1==s2);
        System.out.println(s1.hashCode());
        System.out.println(s2.hashCode());
        System.out.println(s3.hashCode());
        System.out.println(s4.hashCode());

        System.out.println(System.identityHashCode(s1));
        System.out.println(System.identityHashCode(s2));
        System.out.println(System.identityHashCode(s3));
        System.out.println(System.identityHashCode(s4));
    }
    @Test
    public void test() {
        String test = "username=%s,age=%s,sex=%s";
        String[] columns = {"1", "2", "3", "5"};
        System.out.println(String.format(test, columns));
    }
}
